package D12_6z.有参构造_调用方法;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("Y2019.M12_.D12_6z.有参构造_调用方法.Student");
        Constructor<?> c = aClass.getConstructor(String.class, int.class);
        c.setAccessible(true);
        Object o = c.newInstance("小明", 5);
        Method show = aClass.getDeclaredMethod("show");
        show.setAccessible(true);
        System.out.println(show.invoke(o,null));
    }
}
